<!DOCTYPE html>
<!--[if IE 9]>         <html class="ie9 no-focus" lang="zh"> <![endif]-->
<!--[if gt IE 9]><!--> <html class="no-focus" lang="zh"> <!--<![endif]-->
<head>
    <meta charset="utf-8">

    {block name="page-title"}<title>{$page_title|default='后台'} | {:config('zbuilder.web_site_title')} - DolphinPHP</title>{/block}

    <meta name="description" content="{:config('zbuilder.web_site_description')}">
    <meta name="author" content="caiweiming">
    <meta name="robots" content="noindex, nofollow">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0,user-scalable=0">

    <!-- Icons -->
    <!-- The following icons can be replaced with your own, they are used by desktop and mobile browsers -->
    <link rel="shortcut icon" href="__ZBUILDER_IMG__/favicons/favicon.ico">
    <!-- END Icons -->

    <!-- Stylesheets -->
    <!-- Page JS Plugins CSS -->
    {notempty name="_css_files"}
        {volist name="_css_files" id="css"}
        {$assets[$css]|raw}
        {/volist}
    {/notempty}

    {notempty name="extend_css_list"}
        {volist name="extend_css_list" id="vo"}
            {volist name="vo" id="v"}
            <link rel="stylesheet" href="{$v}">
            {/volist}
        {/volist}
    {/notempty}

    {notempty name="_icons"}
        {volist name="_icons" id="icon"}
        <link rel="stylesheet" href="{$icon.url}">
        {/volist}
    {/notempty}

    {block name="plugins-css"}{/block}

    <!-- Bootstrap and OneUI CSS framework -->

    <link rel="stylesheet" href="__LIBS__/sweetalert/sweetalert.min.css">
    <link rel="stylesheet" href="__LIBS__/magnific-popup/magnific-popup.min.css">
    <link rel="stylesheet" href="__ZBUILDER_CSS__/bootstrap.min.css">
    <link rel="stylesheet" href="__ZBUILDER_CSS__/oneui.css">
    <link rel="stylesheet" href="__ZBUILDER_CSS__/dolphin.css" id="css-main">
    <link rel="stylesheet" href="__LIBS__/viewer/viewer.min.css">

    <link rel="stylesheet" id="css-theme" href="__ZBUILDER_CSS__/themes/default.min.css">

    <!--页面css-->
    {block name="style"}{/block}/////////////////////////////////////////////////////////////////////////////////////////////
    {notempty name="_pop"}
    <style>
        #page-container.sidebar-l.sidebar-o {
            padding-left: 0;
        }
        .header-navbar-fixed #main-container {
            padding-top: 0;
        }
    </style>
    {/notempty}
    <!-- END Stylesheets -->

    <!--自定义css-->
    <link rel="stylesheet" href="__ZBUILDER_CSS__/custom.css">
    <script>
        var dolphin = {$dolphin|raw};
    </script>
</head>
<body>
<!-- Page Container -->
<div id="page-container" class="sidebar-l  side-scroll {empty name="_pop"}{$_COOKIE['sidebarMini'] ?= 'sidebar-mini'}{/empty}">
    <!-- Main Container -->
    <main id="main-container">


        <!-- Page Content -->
        <div class="content">
            {// 主体内容}
            {block name="content"}{/block}
        </div>
        <!-- END Page Content -->
    </main>
    <!-- END Main Container -->

</div>
<!-- END Page Container -->

<!-- OneUI Core JS: jQuery, Bootstrap, slimScroll, scrollLock, Appear, CountTo, Placeholder, Cookie and App.js -->
<script src="__ZBUILDER_JS__/core/jquery.min.js"></script>
<script src="__ZBUILDER_JS__/core/bootstrap.min.js"></script>
<script src="__ZBUILDER_JS__/core/jquery.slimscroll.min.js"></script>
<script src="__ZBUILDER_JS__/core/jquery.scrollLock.min.js"></script>
<script src="__ZBUILDER_JS__/core/jquery.appear.min.js"></script>
<script src="__ZBUILDER_JS__/core/jquery.countTo.min.js"></script>
<script src="__ZBUILDER_JS__/core/jquery.placeholder.min.js"></script>
<script src="__ZBUILDER_JS__/core/js.cookie.min.js"></script>
<script src="__LIBS__/magnific-popup/magnific-popup.min.js"></script>
<script src="__ZBUILDER_JS__/app.js"></script>
<script src="__ZBUILDER_JS__/dolphin.js"></script>
<script src="__ZBUILDER_JS__/builder/form.js"></script>
<script src="__ZBUILDER_JS__/builder/table.js"></script>
<script src="__LIBS__/bootstrap-notify/bootstrap-notify.min.js"></script>
<script src="__LIBS__/sweetalert/sweetalert.min.js"></script>
<script src="__LIBS__/js-xss/xss.min.js"></script>
<script src="__LIBS__/viewer/viewer.min.js"></script>
<!-- Page JS Plugins -->
<script src="__LIBS__/layer/layer.js"></script>
{notempty name="_js_files"}
    {volist name="_js_files" id="js"}
{$assets[$js]|raw}
    {/volist}
{/notempty}

{notempty name="extend_js_list"}
    {volist name="extend_js_list" id="vo"}
        {volist name="vo" id="v"}
        <script src="{$v}"></script>
        {/volist}
    {/volist}
{/notempty}

<script>
    jQuery(function () {
        // 切换角色
        $('#js-change-role').click(function () {
            Dolphin.loading();
            $.get('{:url("admin/ajax/getMyRoles")}', function (res) {
                Dolphin.loading('hide');
                if (res.code) {
                    let options = '';
                    $.each(res.data.roles, function (index, item) {
                        options += '<option value="'+index+'" '+(res.data.curr == index ? 'selected' : '')+'>'+item+'</option>';
                    });

                    layer.open({
                        type: 1,
                        title: '<i class="si si-users"></i> 切换角色',
                        area: ['300px', '180px'],
                        btn: ['确定', '取消'],
                        content: '<div class="form-group push-20-t">\n' +
                            '<label class="col-xs-12" for="contact1-subject">当前角色</label>\n' +
                            '<div class="col-xs-12">\n' +
                            '    <select class="form-control" id="role-select" size="1">\n' + options +
                            '    </select>\n' +
                            '</div>\n' +
                            '</div>',
                        yes: function(index, layero){
                            let role = $('#role-select').val();
                            let loading = layer.load(2);
                            $.post('{:url("admin/ajax/setMyRole")}', {id:role}, function (res) {
                                layer.close(loading);
                                if (res.code) {
                                    layer.close(index);
                                    layer.msg(res.msg);
                                    setTimeout(function () {
                                        location.reload();
                                    }, 1500);
                                } else {
                                    layer.msg(res.msg)
                                }
                            });
                        }
                    });
                } else {
                    Dolphin.notify(res.msg, 'danger');
                }
            });
        });
        App.initHelpers(['appear', 'slimscroll', 'magnific-popup', 'table-tools']);
        {notempty name="_js_init"}
        App.initHelpers({$_js_init|raw});
        {/notempty}
    });
</script>

<!--页面js-->
{block name="script"}{/block}

{// 额外HTML代码 }
{$extra_html|raw|default=''}
</body>
</html>